<template>
  <div>
    <crumb />
    <div class="course-study">
      <div class="left-list">
        <LeftTreeList :list="list" :tree-props="treeProps" />
      </div>
    </div>

  </div>
</template>

<script>
import LeftTreeList from '@/components/LeftTreeList'
import { studyIndex } from '@/api/student/lesson/study'
export default {
  data () {
    return {
      list: [],
      treeProps: {
        children: 'childrens',
        label: 'chapterName'
      }
    }
  },
  methods: {
    async studyIndex () {
      const res = await studyIndex()
      this.list = res.data.lessonList
    }
  },
  components: {
    LeftTreeList
  },
  mounted () {
    this.studyIndex()
  }
}
</script>

<style scoped lang="scss">
  .course-study {
    height: 937px;
    width: 1200px;
    margin: 0 auto;
    .left-list {
      width: 452px;
      height: 100%;
    }
  }
</style>
